/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package presenter;

import boundary.DirRegionalView;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

/**
 *
 * @author jakson
 */
public class DirRegionalPresenter {
    
    private DirRegionalView view;

    public DirRegionalPresenter() {
        view = new DirRegionalView(null, true);
        
        view.getItmCadastroGerente().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
               chamaCadastroGerente();
            }
        });
        
        view.getItmManterAgencia().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                chamaManterAgencia();
            }
        });
        
        view.getItmDesativarGerente().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                desativarGerente();
            }
        });
        
        view.getItmTransferir().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                transferirGerente();
            }
        });
        
        view.getItmSair().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
               sair();
            }
        });
        
        view.getItmAbrirConta().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                abrirConta();
            }
        });
        
        view.getItmConsultar().addActionListener(new ActionListener() {

            @Override
            public void actionPerformed(ActionEvent ae) {
                consultarConta();
            }
        });
        
        
        
        view.setLocationRelativeTo(view);
        view.setVisible(true);
    }
    
    private void sair(){
        view.dispose();
    }
    
     private void chamaCadastroGerente(){
         new ListarGerentePresente("novo");
         
     }
     
     private void chamaManterAgencia(){
         new ListarGerentePresente("manter");
     }
     
     private void desativarGerente(){
         
         new ListarGerentePresente("desativar");
         
     }
    
     private void transferirGerente(){
         new ListarGerentePresente("transferir");
     }
     
     private void abrirConta(){
         new ListarClientePresenter("criaConta");
     }
     
     private void consultarConta(){
         new ListarContasCorrentesPresenter();
     }
}
